package com.cjl.service.impl;

import com.cjl.entity.EbOrder;
import com.cjl.mapper.OrderMapper;
import com.cjl.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service

public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<EbOrder> listByPage(Integer page,Integer pageSize) {
        System.out.println("service -------调用了Service的listByPage方法");
        int from = (page - 1) * pageSize;
        return orderMapper.findByPage(from,pageSize);
    }

    @Override
    public Integer findTotalPage(Integer pageSize) {
        return orderMapper.getTotalPage(pageSize);
    }


    @Override
    public EbOrder selectOne(Integer eoId){
        return orderMapper.selectOne(eoId);
    }
    @Override
    public Integer updateOrder(EbOrder ebOrder){
        return orderMapper.updateByPrimaryKey(ebOrder);
    }

    @Override
    public int deleteByPk(int id) {
        return orderMapper.deleteByPk(id);
    }
}

